@extends('master')

@section('title')
    管理员
@stop

@section('content')
    <div class="container">
        <div class="row mt-5">
            <div class="col-md-10">
                @include('errors.list')

                <h3 align="center">订单信息表</h3>
                <table class="table table-hover">
                    <tr>
                        <td>订单编号</td>
                        <td>订单标题</td>
                        <td>订单内容</td>
                        <td>发单者</td>
                        <td>接单者</td>
                        <td>酬金</td>
                        <td>订单类别</td>
                        <td>订单状态</td>
                        <td>操作</td>
                    </tr>
                    @if (count($orders))
                        @foreach ($orders as $order)
                            <tr>
                                <td>{{ $order->id }}</td>
                                <td>{{ $order->title }}</td>
                                <td>{{ $order->content }}</td>
                                <td>{{ $order->provider }}</td>
                                <td>{{ $order->receiver }}</td>
                                <td>{{ $order->price }}</td>
                                <td>{{ $order->type }}</td>
                                <td>{{ $order->status }}</td>
                                <td>
                                    <form action="{{ url( 'orders/'.$order->id.'/destroy' ) }}" style='display: inline' method="get"
                                    onclick="location.reload()">
                                        <input type="hidden" name="_method" value=POST">
                                        <input type="hidden" name="_token" value="{{csrf_token()}}">
                                        <button class="btn btn-sm btn-danger" onclick="return confirm('确定删除?')">删除</button>
                                    </form>
                                </td>
                            </tr>

                        @endforeach
                    @else
                        <h1>暂无订单显示</h1>
                    @endif
                </table>
                <?php echo $orders->render(); ?>
            </div>

            {{--@include('Admin.right_bar')--}}
        </div>
    </div>
@stop